#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QLabel>
#include <QListWidget>
#include <QPushButton>
#include <QGridLayout>
#include <QPushButton>
#include <QLineEdit>
#include <QImage>
#include <QByteArray>
#include <QComboBox>
#include <QApplication>
#include <QBuffer>
#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QHttpMultiPart>
#include <QFile>
#include <QUrlQuery>
#include <QJsonParseError>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QBuffer>
#include <QFileDialog>
#include <QMessageBox>
#include <QImage>
#include <QIcon>
#include <QDialog>
#include <QTimer>
#include <QImage>
#include <QMessageBox>
#include <QDebug>
#include <QIcon>
#include <QApplication>
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/ml/ml.hpp>
#include <QFileDialog>
#include <QLabel>
#include <QPushButton>
#include <QGridLayout>
#include <QImage>
#include <QMessageBox>
#include <QDebug>
#include <QIcon>
#include <QApplication>
#include <iostream>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/ml/ml.hpp>
#include <QFileDialog>
#include <synchapi.h>
using namespace std;
using namespace cv;


class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = 0);
    ~Dialog();

private:
    QLabel *pictureLabel;
    QLabel *processLabel;
    QLabel *ageLabel;
    QLabel *genderLabel;
    QLabel *beautyLabel;
    QLabel *expressionLabel;
    QPushButton *pictureBtn;
    QPushButton *processBtn;
    QPushButton *renlianjianceBtn;
    QPushButton *mp4Button;
    QGridLayout *mainLayout;
    QLineEdit *nameLineEdit;
    QLineEdit *genderLineEdit;
    QLineEdit *beautyEdit;
    QLineEdit *expressoionLineEdit;
    QLineEdit *ageLineEdit;
    QLineEdit *mp4LineEdit;


    QNetworkAccessManager *manager;

    //应答数据
    QByteArray replyData;

    //请求地址
    QString requestUrl;
    //Access Token
    QString accessToken;

    QTimer *timer;
    QTimer *timer1;
    QImage *imag;

    VideoCapture capture;
    cv::Mat frame;

    QPushButton *open;
    QPushButton *close;
    QPushButton *cameraprocessBtn;



private slots:
    void xingrenjiance();
    void openpicture();
    void replyFinished(QNetworkReply *reply);
    void on_btnStartIdentify_clicked();
    void opencamera();
    void closeCamera();
    void readFrame();
    void cameraprocess();
    void xinrenjiancecamera(cv::Mat src);
    void opencvmp4();
    void fllow();
};

#endif // DIALOG_H
